﻿/* *********************************
 * 项目名称：会员页面继承的类
 * 模块功能：会员页面初始化继承
 * *********************************/
using System;
using System.Web;
using System.Text;

/// <summary>
/// MpageBase 的说明：
/// 会员页面继承的类
/// </summary>
public class MpageBase : System.Web.UI.Page
{
    /// <summary>
    /// 获取当前登录用户信息
    /// </summary>
    protected Model.CMember loginUserInfo = null;
    /// <summary>
    /// 初始化
    /// </summary>
    protected virtual void Page_Init()
    {
        #region 检查登录状态
        ckLogin();
        #endregion
    }
    /// <summary>
    /// 检查登录状态
    /// </summary>
    protected void ckLogin()
    {
        //获取登录信息
        loginUserInfo = BLL.CMember.UserLoginInfo();
        //当前用户没有登录
        if (loginUserInfo == null)
        {
            //跳转到会员登录页
            Response.Redirect("/login.aspx");
            //System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">window.location.href = '/Default.aspx';</script>");
        }
    }
    public void alertmessage(string message)
    {
        System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('" + message + "');</script>");
    }
    public void alertmessageAndGoback(string message)
    {
        System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('" + message + "');history.go(-1);</script>");
    }
    public void alertmessageAndGo(string message, string url)
    {
        System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('" + message + "');window.location.href = '" + url + "';</script>");
    }
}